package com.wiscamp.ninechapters.panels.infrastructure.views;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 权限表
 */
@Data
@Entity
@Table(name = "permissions_view")
public class PermissionView {

    /**
     * 权限编号
     */
    @Id
    @Column(name = "permission_id", nullable = false)
    private long permissionId = 0L;

    /**
     * 应用编号
     */
    @Column(name = "application_id", nullable = false)
    private long applicationId = 0L;

    /**
     * 权限代码
     */
    @Column(name = "permission_code", nullable = false)
    private String permissionCode = "";

    /**
     * 权限名称
     */
    @Column(name = "permission_name", nullable = false)
    private String permissionName = "";

    /**
     * 权限分组
     */
    @Column(name = "permission_group", nullable = false)
    private String permissionGroup = "";

    /**
     * 权限类型编号
     */
    @Column(name = "permission_type_id", nullable = false)
    private long permissionTypeId = 0L;

    /**
     * 权限层级
     */
    @Column(name = "permission_level", nullable = false)
    private int permissionLevel = 0;

    /**
     * 上层权限编号
     */
    @Column(name = "parent_id", nullable = false)
    private long parentId = 0L;

    /**
     * 标识符
     */
    @Column(name = "identifier", nullable = false)
    private String identifier = "";

    /**
     * 访问类型编号
     */
    @Column(name = "access_type_id", nullable = false)
    private long accessTypeId = 0L;

    /**
     * 范围类型编号
     */
    @Column(name = "scope_type_id", nullable = false)
    private long scopeTypeId = 0L;

    /**
     * 资源名称
     */
    @Column(name = "resource_name", nullable = false)
    private String resourceName = "";

    /**
     * 备注
     */
    @Column(name = "remark", nullable = false)
    private String remark = "";

    /**
     * 创建用户
     */
    @Column(name = "creator_id", nullable = false, updatable = false)
    private long creatorId = 0L;

    /**
     * 创建时间
     */
    @Column(name = "creation_time", nullable = false, updatable = false)
    private LocalDateTime creationTime;

    /**
     * 编辑用户
     */
    @Column(name = "modifier_id", nullable = false)
    private long modifierId = 0L;

    /**
     * 编辑时间
     */
    @Column(name = "modification_time", nullable = false)
    private LocalDateTime modificationTime;

    /**
     * 是否启用
     */
    @Column(name = "enabled", nullable = false)
    private boolean enabled = true;

    /**
     * 是否删除
     */
    @Column(name = "deleted", nullable = false)
    private boolean deleted = false;

    /**
     * 创建人名称
     */
    @Column(name = "permission_type_name", nullable = false)
    private String permissionTypeName = "";

    /**
     * 编辑人名称
     */
    @Column(name = "access_type_name", nullable = false)
    private String accessTypeName = "";

    /**
     * 编辑人名称
     */
    @Column(name = "scope_type_name", nullable = false)
    private String scopeTypeName = "";

    /**
     * 创建人名称
     */
    @Column(name = "creator_name", nullable = false)
    private String creatorName = "";

    /**
     * 编辑人名称
     */
    @Column(name = "modifier_name", nullable = false)
    private String modifierName = "";
}
